package com.mall.db.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author hsp
 * @since 2021-09-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_order")
public class Order extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 下单会员
     */
    private String member;

    /**
     * 下单时间
     */
    @JSONField(format = "yyyy-MM-dd hh:mm:ss")
    private Date orderTime;

    private String commodityId;
    /**
     * 订单状态
     */
    private String state;

    /**
     * 订单金额
     */
    private String orderAmount;

    /**
     * 实付金额
     */
    private String paidinAmount;

    /**
     * 支付时间
     */
    @JSONField(format = "yyyy-MM-dd hh:mm:ss")
    private Date aymentTime;

    /**
     * 收货人
     */
    private String consignee;

    /**
     * 物流单号
     */
    private String oddNumbers;

    /**
     * 物流渠道
     */
    private String channel;

    /**
     * 以前下单商品
     */
    private String oldCommodity;

    /**
     * 想要换的商品
     */
    private String newCommodity;

//    public String getCommodityId() {
//        if (!StringUtils.isEmpty(commodityId)){
//            commodityId= JSON.parseObject(commodityId,Integer.class);
//        }
//        return commodityId;
//    }
}
